<template>
  <div class="payment-info">
    <van-nav-bar title="提交订单" left-arrow @click-left="$router.back()"/>

    <van-popup v-model="showPopup" position="bottom">

      <van-datetime-picker
          :type="'datetime'"

          @confirm="onConfirm"
          @cancel="onCancel"
      />
    </van-popup>

    <h1 @click="XiuGai()">预约时间</h1>




    <div class="order-footer">
      <div class="order-price">
        <span class="price-label">合计:    </span>
      </div>
      <button class="accept-btn" @click="JieDan(item.id)">立即支付</button>
    </div>
<!--    </div>-->
  </div>
</template>

<script>
export default {
  props: {
    order: Object
  },
  data() {
    return {
      showPopup: false,
      minDate: new Date(2024, 11, 20),  // 设置最小日期
      maxDate: new Date(2025, 11, 31), // 设置最大日期
    };
  },
  methods: {
    XiuGai(id) {
      this.time = {};
      // this.time.id = id;
      this.showPopup = true
    },
    onConfirm(value) {
      this.time.orderBegintime = value;
      this.showPopup = false;
      this.showPopup2 = true;
    },
    // 取消选择
    onCancel() {
      this.showPopup = false;
      this.showPopup2 = false;
    },
    fan(){
      location.href="#/fu";
    },
    cancelOrder() {
      // 这里添加取消订单的具体逻辑，比如调用后端接口等
      console.log('取消订单逻辑');
    },
    submitOrder() {
      // 这里添加提交订单的具体逻辑，比如调用后端接口等
      console.log('提交订单逻辑');
    }
  }
};
</script>

<style scoped>
.payment-info {
  border: 1px solid #ccc;
  padding: 10px;
}
</style>
